﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

namespace BSCMFF.Web.UserControls.Evaluation
{
    public partial class BonusSettings : System.Web.UI.UserControl
    {
        private bool noCompetency;
        public bool NoCompetency
        {
            get
            {
                return noCompetency;
            }
            set
            {
                noCompetency = value;
            }
        }

        public bool Enabled 
        { 
            get
            {
                return RadSliderBonus.Enabled;
            }
            set
            {
                RadSliderBonus.Enabled = value;
            }
        }

        public int Value
        {
            get
            {
                return (int)RadSliderBonus.Value;
            }
            set
            {
                RadSliderBonus.Value = value;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (noCompetency == true)
            //{
            //    RadSliderBonus.Value = 0;
            //    RadSliderBonus.Enabled = true;
            //    RadSliderBonus.EnableDragRange = false;
            //    //RadSliderBonus.
            //}

            if (((CheckBox)this.Parent.FindControl("CheckBoxCompetencies")).Checked == false)
            {
                PlaceholderSlider.Visible = false;
                //RadSliderBonus.Value = 0;
                //RadSliderBonus.Enabled = false;
                //soft.Value = RadSliderBonus.Value.ToString() + "%";
                //hard.Value = (100 - RadSliderBonus.Value).ToString() + "%";
                //LabelDivideBonus.Text = "Only Personal KPIs are selected";
                //LabelDivideBonus.ForeColor = Color.Orange;
                //RadSliderBonus.ToolTip = "Only Personal KPIs are selected";
                //RadSliderBonus.EnableDragRange = false;
            }
            if (((CheckBox)this.Parent.FindControl("CheckBoxPKPIs")).Checked == false)
            {
                PlaceholderSlider.Visible = false;
                //RadSliderBonus.Value = 100;
                //RadSliderBonus.Enabled = false;
                //soft.Value = RadSliderBonus.Value.ToString() + "%";
                //hard.Value = (100 - RadSliderBonus.Value).ToString() + "%";
                //LabelDivideBonus.Text = "Only Competencies are selected";
                //LabelDivideBonus.ForeColor = Color.Orange;
                //RadSliderBonus.ToolTip = "Only Competencies are selected";
            }

            if (((CheckBox)this.Parent.FindControl("CheckBoxPKPIs")).Checked == true &&
                ((CheckBox)this.Parent.FindControl("CheckBoxCompetencies")).Checked == true)
            {
                PlaceholderSlider.Visible = true;
                //RadSliderBonus.Enabled = true;
                ////RadSliderBonus.dra
                //RadSliderBonus.Value = 10;
                //soft.Value = RadSliderBonus.Value.ToString() + "%";
                //hard.Value = (100 - RadSliderBonus.Value).ToString() + "%";

                //LabelDivideBonus.Text = "Divide Bonus";
                //LabelDivideBonus.ForeColor = Color.Black;
            }
        }
    }
}